package com.dly.hope.modle;


import com.dly.hope.type.SessionType;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户的会话
 */
@Entity
@Table(name = "hope010_session")
@DynamicUpdate
@DynamicInsert

@Data
public class Session extends BaseEntity {

    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    private String id;

    @Column(name = "user_id")
    @Comment(value = "用户id")
    private String userId;

    @Column(name = "session_id")
    @Comment(value = "会话id(跟谁对话)")
    private String sessionId;

    @Column(name = "session_type")
    @Comment(value = "类型")
    @Enumerated(EnumType.STRING)
    private SessionType sessionType;
}
